package com.hlkj.pay.vo.order.resp;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hlkj.framework.mybatis.core.dataobject.BaseDO;
import com.hlkj.pay.app.merchant.ext.MerchantExtConstant;
import com.hlkj.pay.app.merchant.ext.impl.wxpay.dto.WxPayConfig;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;


/**
* 订单通知表
* @TableName t_order_notify
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class OrderComplaintChannelResp extends BaseDO {

    @Schema(description = "主体")
    private String subject;

    @Schema(description = "状态")
    private Integer status;

    @Schema(description = "渠道类型 1:微信 2：支付宝")
    private Integer type;

    @Schema(description = "基本配置json")
    private String baseConfig;



    @Schema(description = "基本配置")
    private WxPayConfig baseConfigObj;

    @Schema(description = "投诉回调地址")
    private String complaintNotifyUrl;

    @Schema(description = "风险回调地址")
    private String riskNotifyUrl;

    @Schema(description = "创建回调成功的商户号")
    private String mchid;

    @Schema(description = "默认投诉回调地址")
    private String defaultComplaintNotifyUrl;

    @Schema(description = "默认风险回调地址")
    private String defaultRiskNotifyUrl;

    @JsonIgnore
    private String channelCode;

    public String getChannelCode() {
        String channelCode = null;
        switch (this.type){
            case 1:
                channelCode = MerchantExtConstant.CHANNEL_WX_PAY;
                break;
            case 2:
                channelCode = MerchantExtConstant.CHANNEL_ALI_PAY;
                break;
        }
        return channelCode;
    }
}
